package com.bnp.reporting.java8.lambda;

import com.bnp.reporting.java8.entity.Employee;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;

/**
 * Created by Adib on 11/19/2014.
 */
public class EmployeeExmpl {
    public static void main(String[] args) {

        List<Employee> reportingTeam = initEmployees();
/*
        Employee employee = findEmployeeByFirstName(reportingTeam, "HongFei");
        System.out.println(employee.getLastName());
        employee = findEmployeeBySalary(reportingTeam, 12);
        System.out.println(employee.getLastName());
        employee = findFirstMatchingEmployee(reportingTeam, e -> e.getFirstName().equals("Adib"));
        System.out.println(employee.getLastName());
        employee = findFirstMatchingEmployee(reportingTeam, e -> e.getSalary() > 25 );
        System.out.println(employee.getLastName());
        employee = firstMatch(reportingTeam, e -> e.getSalary() > 20);
        System.out.println(employee.getLastName());
        */
    }

    //febfn find employee by first name

    //febs find employee by salary

    //ffme find first matching employee


    //fm find match


    private static List<Employee> initEmployees() {
        Employee adib = new Employee("Adib", "Souly", 10);
        Employee hongfei = new Employee("HongFei", "Zhu", 20);
        Employee tanguy = new Employee("Tanguy", "Bayard", 30);
        Employee zhihai = new Employee("Zhihai", "He", 25);
        List<Employee> reportingTeam = new ArrayList<>();
        reportingTeam.add(tanguy);
        reportingTeam.add(adib);
        reportingTeam.add(hongfei);
        reportingTeam.add(zhihai);
        return reportingTeam;
    }


}
